<template>
  <div>
    <div>
      <div style="display: inline-block">
        <el-button icon="el-icon-back" size="small" type="text" @click="goBack">返回</el-button>
      </div>
      <div style="display: inline-block">|</div>
      <div style="display: inline-block;">
        <div style="padding-bottom: 15px;margin-left:10px">
          <span style=" font-family: 'Microsoft YaHei',serif;display: inline-block">管理</span>
        </div>
      </div>
    </div>
    <el-tabs v-model="activeName" type="card">
      <el-tab-pane label="知识发布" name="first">
        <TempKnowledgeTable :id=this.$route.query.id @released="refreshSyncTable" ref="tempTable"></TempKnowledgeTable>
      </el-tab-pane>
      <el-tab-pane label="知识推送" name="second">
        <SynchronizationTable :id=this.$route.query.id ref="syncTable"
                              :isToPlatform=this.$route.query.isToPlatform></SynchronizationTable>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import TempKnowledgeTable from "../../knowledgeLibFiled/manage/TempKnowledgeTable";
import SynchronizationTable from "../../knowledgeLibFiled/manage/SynchronizationTable";

export default {
  name: "Manage",
  components: {
    TempKnowledgeTable,
    SynchronizationTable
  },
  data() {
    return {
      activeName: 'first',
    };
  },
  methods: {
      goBack: function () {
        this.$router.push("/knowledgelib")
        this.$destroy(this.$options.manage)
      },
      refreshSyncTable() {
        this.$refs.syncTable.getTableData()
      }
    },
    activated() {
      if (this.$route.meta.isUseCache) {
        return
      }
      this.$refs.syncTable.handleSizeChange(10);
      this.$refs.tempTable.getTableData();
    }
  }
</script>

<style scoped>

</style>
